package com.nchu.boot.ai.action;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tensorflow.TensorFlow;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author fujianjian
 * @project self-learning
 * @date 2019/11/23 22:26
 */
@Slf4j
@RestController
public class IndexAction {


    @GetMapping("/index")
    public Map index() {
        Map ret = new HashMap<>();
        ret.put("code", 200);
        ret.put("msg", "this is index");
        ret.put("os", System.getProperty("os.name"));
        ret.put("core size", Runtime.getRuntime().availableProcessors());
        ret.put("tensorflow", TensorFlow.version());
        ret.put("timestamp", LocalDateTime.now().toString());
        return ret;
    }

}
